//
//  AlertPrompt.m
//  Prompt
//
//  Created by Jeff LaMarche on 2/26/09.

#import "AlertPrompt.h"

@implementation AlertPrompt

@synthesize textField;

- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle okButtonTitle:(NSString *)okayButtonTitle placeholderText:(NSString *)placeholderText
{
    
    if (self = [super initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:okayButtonTitle, nil])
    {
//            UIAlertView *inputDialog = [[UIAlertView alloc] initWithTitle:@"Server Password" message:@"\n\n\n"
//                    delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel",nil) otherButtonTitles:NSLocalizedString(@"OK",nil), nil];
            
        UILabel *passwordLabel = [[UILabel alloc] initWithFrame:CGRectMake(12,40,260,25)];
        passwordLabel.font = [UIFont systemFontOfSize:16];
        passwordLabel.textColor = [UIColor whiteColor];
        passwordLabel.backgroundColor = [UIColor clearColor];
        passwordLabel.shadowColor = [UIColor blackColor];
        passwordLabel.shadowOffset = CGSizeMake(0,-1);
        passwordLabel.textAlignment = UITextAlignmentCenter;
        passwordLabel.text = @"Caretaker Email";
        [self addSubview:passwordLabel];
            
        UITextField *dialogInput = [[UITextField alloc] initWithFrame:CGRectMake(16,83,252,25)];
        dialogInput.autocapitalizationType = UITextAutocapitalizationTypeNone;
        dialogInput.autocorrectionType = UITextAutocorrectionTypeNo;
        dialogInput.borderStyle = UITextBorderStyleRoundedRect;
        dialogInput.keyboardType = UIKeyboardTypeEmailAddress;
        //dialogInput.font = [UIFont systemFontOfSize:18];
        //dialogInput.backgroundColor = [UIColor whiteColor];
//            dialogInput.keyboardAppearance = UIKeyboardAppearanceAlert;
            //        passwordField.delegate = self;
        self.textField = dialogInput;
        [self addSubview:dialogInput];
            
        [self setTransform:CGAffineTransformMakeTranslation(0,0)];
    }
    return self;
}
//UIAlertView *alert;
//
//alert = [[UIAlertView alloc] initWithTitle:@"Please wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
//
//UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:
//                                      UIActivityIndicatorViewStyleWhiteLarge];
//indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);
//[indicator startAnimating];
//[alert addSubview:indicator];



- (void)show
{
    [super show];
}

- (NSString *)enteredText
{
    return textField.text;
}

@end
